<template>
  <div>
    vip茶楼
    <el-form :label-position="labelPosition" label-width="80px"  class="vip-form">
      <el-form-item label="旧茶楼号">
        <el-input v-model="params.oldcode"></el-input>
      </el-form-item>
      <el-form-item label="新茶楼号">
        <el-input v-model="params.newcode"></el-input>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" @click="changeHouse()">确认改成vip茶楼</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>
<style lang="less" scoped>
.vip-form{
    width: 50%;
    margin-top: 60px;
}
</style>
<script>
import { modifyHouse } from "@/api";
import { showTips } from "@/utils";
export default {
  data() {
    return {
      params: {
        oldcode: null,
        newcode: null
      },
      labelPosition: "right",
    };
  },
  mounted() {},
  methods: {
    changeHouse() {
      modifyHouse(this.params).then(res => {
        console.log(res);
        if(res.code == 200){
            //修改成功
             showTips("success", "修改成功");
             this.params = {};
        }else{
            showTips("warning", "修改失败"); 
        }
      });
    }
  }
};
</script>